﻿#ifndef DACONFIGDIALOG_H
#define DACONFIGDIALOG_H

#include "BaseConfig.h"
#include "DASetting.h"
#include "PluginManager.h"
#include "qbuttongroup.h"
#include "qevent.h"
#include "qlabel.h"
#include "qpushbutton.h"
#include <QDialog>
#include <QListWidget>
#include <QTableWidget>
#include <QStackedWidget>

class DAConfigDialog : public QDialog
{
    Q_OBJECT
public:
    DAConfigDialog(QWidget *parent = nullptr);
    
    
    void MenuListTitle(const QString &title);
    void MenuListAddItem(const QString &text, QWidget *widget = nullptr);
    void MenuListAddItem(const QString &text, int index);//调试用
    
public slots:
    void BtnGroupClicked(int index);
    void BtnMenuListClicked(int index);
    
private:
    void Init();
    void Default();
    void InitLayout();
    void BindBtnSlot();
    void resizeEvent(QResizeEvent *event);
private:
    QStackedWidget *SetPage;
    QListWidget *MenuList;
//    QTabWidget *BaseTab;
    BaseConfig *BaseSet;
    PluginManager *PluginSet;
    DASetting *dasettings;
    QLabel *LabTitle;
    QButtonGroup *BtnGroup;     // 按钮组
    QButtonGroup *MenuListBtn;  // 菜单按钮
    QPushButton *Confirm;       // 保存并关闭
    QPushButton *Cancel;        // 关闭
    QPushButton *Apply;         // 保存
    int menu_btn_id = 0;        // 菜单按钮id
};

#endif // DACONFIGDIALOG_H
